package com.components.project.web

import android.content.Intent
import android.os.Bundle
import com.blankj.utilcode.util.ActivityUtils
import com.components.project.X5Activity
import com.components.project.databean.NewsDataBean

object IntentManager {

    fun intentWebView(newsDataInfo: NewsDataBean) {
        val topActivity = ActivityUtils.getTopActivity()
        val intent = Intent(topActivity, X5Activity::class.java)
        val bundle = Bundle()
        bundle.putSerializable("newsData", newsDataInfo)
        intent.putExtras(bundle)
        topActivity.startActivity(intent)
    }

    fun intentWebView(webIntentParam: WebViewIntentParam, newsDataInfo: NewsDataBean) {
        val topActivity = ActivityUtils.getTopActivity()
        val bundle = Bundle()
        bundle.putSerializable("intentParam", webIntentParam)
        bundle.putSerializable("newsData", newsDataInfo)
        val intent = Intent(topActivity, X5Activity::class.java)
        topActivity.startActivity(intent)
    }

}